/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#include "ServerChangeScene.h"

namespace PQClient
{

	ServerChangeScene::ServerChangeScene(Ogre::RenderWindow* win) : SceneObject(win),
		_status(Server_Change_Disconnect)
	{
	}

	void ServerChangeScene::loadScene()
	{
		SceneObject::loadScene();
		
		this->getRenderProperty().setBackground(Ogre::ColourValue(0,1,1));
	}

	void ServerChangeScene::update(float deltaT)
	{
		SceneObject::update(deltaT);
		switch(_status){
		case Server_Change_Disconnect:
			connect();
			break;
		case Server_Change_Connect_Success:
			//SendCGConnectMsg();
			break;
		case Server_Change_Sending_Connect:
			break;
		case Server_Change_Receive_Connect_Success:
			//ChangeToEnterGameProdure();
			break;
		case Server_Change_Receive_Connect_Fail:
			break;
		default:
			break;
		}
	
	}

	void ServerChangeScene::connect()
	{
		int32 port=89;
		port++;
		/*
		std::string strIp = CGameProcedure::s_pVariableSystem->GetAs_String("GameServer_Address");
		INT			iPort = CGameProcedure::s_pVariableSystem->GetAs_Int("GameServer_Port");
		CNetManager::GetMe()->ConnectToServer(strIp.c_str(), iPort);
		SetStatus(CHANGESCENE_CONNECTING);
		*/
	}



}
